package com.google.code.netbuilder.dal.entities;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlType(propOrder = {"id", "fromPortId", "toPortId", "number"}, 
                         name = "Wire")
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@Table(name = "wire")
@SequenceGenerator(name="seq", initialValue=1, allocationSize=100)
public class Wire {

        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq")
	Integer id;
        @Column(name="from_port_id")
	Integer fromPortId;
        @Column(name="to_port_id")
	Integer toPortId;
	Integer number;
        @Temporal(javax.persistence.TemporalType.DATE)
	Date date;
	
	public Date getDate() {
		return date;
	}

	public void setDate(long millisecond) {
		this.date = new Date(millisecond);
	}
	
	public void setDate(Date date) {
		this.date = date;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getFromPortId() {
		return fromPortId;
	}

	public void setFromPortId(Integer fromPortId) {
		this.fromPortId = fromPortId;
	}

	public Integer getToPortId() {
		return toPortId;
	}

	public void setToPortId(Integer toPortId) {
		this.toPortId = toPortId;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

}
